﻿using ReflectionStudio.Components.UserControls;
using ReflectionStudio.Core.Events;
using System;
using System.ComponentModel;
using System.Data;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace WPFExcelReport
{
    public partial class MainWindow : DocumentBase
    {
        private NameScope pagescope = new System.Windows.NameScope();
        public MainWindow()
        {
            InitializeComponent();
            this.Name = "销售单多地址";
        }
        string CurrentUI = "";
        ViewBase UI;
        MessageInfo msg;
        //子窗口的加载晚于主窗口，应当等所有窗口加载完成之后，再进行发送消息和接受消息的命令
        public override void OnWorkflowIDChange(MessageEventArgs e)
        {
            base.OnWorkflowIDChange(e);
            msg = e.Info;
            string wfid = msg.Details;
            switch (wfid)
            {
                case "VKA02":
                    if (CurrentUI == wfid)
                    {
                        UI.ORDERNUM = msg.ORDER;
                        return;
                    }
                    CurrentUI = wfid;
                    UI = new TVKADR();
                    MainTab.Children.Add(UI);
                    UI.ORDERNUM = "";
                    UI.ORDERNUM = msg.ORDER;
                    pagescope.RegisterName(UI.Name, UI);
                    break;
            }
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            
        }

    }
}
